import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { ACCOUNT_CONTROL } from './baseUrlConfig';

@Injectable({
  providedIn: 'root'
})
export class AccountService {

  constructor(
    private httpClient: HttpClient,
    private router: Router,
  ) { }

  login(username: string, password: string) {
    return new Promise((resolve) => {
      this.httpClient.get(ACCOUNT_CONTROL + `?username=${username}&password=${password}`).subscribe(response => {
        resolve(response);
      })
    })
  }
}
